<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <style type="text/css">
        .div1{background: #000080;border: lpx solid red; /*解决代码*/width: 98%; margin-bottom: 10px;float: left;}
        .div2{background: #800080;border: lpx solid red; height: 100px;width: 98%;/*解决代码*/ clear: both;}
        .left{float:left;width:20%;height:200px;background:#DDD}
        .right{float:right;width:30%;height:80px;background:#DDD}
    </style>
</head>
<body>
<div class="div1">
    <div class="left">Left</div>
    <div class="right">Right</div>
</div>
<div class="div2">
    div2
</div>

</body>
</html>